package com.aspose.cells.a.d;

import java.util.Iterator;

public class zgd extends zge {
   private zct a;
   private zcv b;

   public zgd(zct var1) {
      super("/Resources");
      this.a = var1;
   }

   public String a(zfq var1) throws Exception {
      String var2 = super.a(var1);
      this.b.e().a("http://schemas.microsoft.com/xps/2005/06/required-resource", var2, false);
      return var2;
   }

   public zgj a(byte[] var1) throws Exception {
      zgj var2 = super.a(var1);
      this.b.e().a("http://schemas.microsoft.com/xps/2005/06/required-resource", var2.a(), false);
      return var2;
   }

   public void a() throws Exception {
      Iterator var1 = this.e().keySet().iterator();

      Object var2;
      while(var1.hasNext()) {
         var2 = var1.next();
         this.a.b().a(zgi.a((zft)this.e().get(var2), (String)var2));
      }

      var1 = this.f().keySet().iterator();

      while(var1.hasNext()) {
         var2 = var1.next();
         zcv var3 = a((zgj)this.f().get(var2));
         this.a.b().a(var3);
      }

   }

   public void a(int var1) throws Exception {
      zcv var2 = new zcv(com.aspose.cells.b.a.zv.a("/Documents/1/Pages/{0}.fpage", var1), "application/vnd.ms-package.xps-fixedpage+xml");
      this.b = var2;
   }

   public void b() throws Exception {
      this.a.b().a(this.b);
   }

   private static zcv a(zgj var0) throws Exception {
      int var1 = zbn.a(var0.c());
      zcv var2 = new zcv(var0.a(), b(var1));
      var2.d().b(var0.c(), 0, var0.c().length);
      return var2;
   }

   private static String b(int var0) {
      switch(var0) {
      case 4:
         return "image/jpeg";
      case 5:
         return "image/png";
      case 6:
      case 7:
      default:
         throw new IllegalStateException("Unexpected image type.");
      case 8:
         return "image/tiff";
      }
   }

   public zcv c() {
      return this.b;
   }
}
